using System;
using System.Collections.Generic;
using UnityEngine;

public class C_攻击判断 : MonoBehaviour
{
	public int _阵营;

	public float _伤害 = 10f;

	public float _僵直伤害 = 10f;

	public float _击退力度 = 5f;

	private HashSet<IBeAttack> _Hsah_本次受击人员 = new HashSet<IBeAttack>();

	public event Action _攻击命中回调 = delegate
	{
	};

	private void OnEnable()
	{
		_Hsah_本次受击人员.Clear();
	}

	private void OnTriggerEnter2D(Collider2D collision)
	{
		if (collision.TryGetComponent<IBeAttack>(out var component) && component._阵营 != _阵营 && !_Hsah_本次受击人员.Contains(component))
		{
			this._攻击命中回调();
			_Hsah_本次受击人员.Add(component);
			component.BeAttack(_伤害, _僵直伤害, _击退力度, base.transform.parent.transform.position);
		}
	}
}
